Skip to content

feat: add project-name option to create#969

Open
tejaskash wants to merge 2 commits intomainfrom
feature/add-project-name-create-main
Open

feat: add project-name option to create#969
tejaskash wants to merge 2 commits intomainfrom
feature/add-project-name-create-main

Conversation

@tejaskash
Copy link
Copy Markdown
Contributor

Summary

Adds an optional --project-name flag to agentcore create so the project/folder name can be set independently from the resource name supplied by --name.

On main, --name continues to identify the default runtime resource while --project-name controls the generated project name and directory. Existing calls without --project-name keep the prior behavior.

Validation

  • npm run build
  • Created a real project with: node dist/cli/index.mjs create --project-name CliProjMainFinal --name CliAgentResourceFinal123456 --defaults --skip-git --skip-install --json --output-dir /tmp/agentcore-cli-create-check-main-final
  • Verified agentcore.json has project CliProjMainFinal, runtime CliAgentResourceFinal123456, and the runtime app directory exists.

@github-actions github-actions Bot added size/m PR size: M agentcore-harness-reviewing AgentCore Harness review in progress labels Apr 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.11.0.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-969-tarball/aws-agentcore-0.11.0.tgz

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Apr 25, 2026
@tejaskash tejaskash marked this pull request as ready for review April 27, 2026 15:49
@tejaskash tejaskash requested a review from a team April 27, 2026 15:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.48% 7397 / 17410
🔵 Statements 41.91% 7843 / 18712
🔵 Functions 40.43% 1306 / 3230
🔵 Branches 40.75% 4888 / 11994
Generated in workflow #2008 for commit 163bab0 by the Vitest Coverage Report Action

Comment thread src/cli/commands/create/command.tsx Outdated
.command('create')
.description(COMMAND_DESCRIPTIONS.create)
.option('--name <name>', 'Project name (start with letter, alphanumeric only, max 23 chars) [non-interactive]')
.option('--name <name>', 'Resource name [non-interactive]')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove the description? it is needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the description to 'Resource name (agent or harness) [non-interactive]' — the old project-name constraints now live on --project-name.

Comment thread src/cli/commands/create/command.tsx Outdated
/** Handle CLI mode with progress output */
async function handleCreateCLI(options: CreateOptions): Promise<void> {
const cwd = options.outputDir ?? getWorkingDirectory();
const projectName = options.projectName ?? options.name!;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name! assertion can technically be undefined when someone passes --no-agent --project-name Foo without --name.

it works right now because the .action() handler patches name before calling this function, but if handleCreateCLI ever gets called from somewhere else it'll break silently. Can we move that backfill logic into handleCreateCLI methoid directly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the backfill into the handler function itself — it now derives name and projectName with cross-fallback at the top, and the .action() caller no longer patches opts.name.

@tejaskash tejaskash changed the title Add project-name option to create feat: add project-name option to create Apr 27, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants